import React from 'react';
import { fetchApproveArticles } from '../actions/article';
import { connect } from 'react-redux';
import Approvals from '../components/Approvals';
import LoadMore from '../components/loadmore';
import { Link } from 'react-router';
import NormalHeaderBar from '../components/NormalHeaderBar';

class Approvalpage extends React.Component {
    constructor(props) {
        super(props);
    }

    componentDidMount() {
        this.props.fetchApproveArticles();
    }

    handleLoad() {
        this.props.fetchApproveArticles();
    }

    render() {
        return (
            <div>
                <NormalHeaderBar title="我的审批" />
                <Approvals back="approvalpage" articles={this.props.articles} />
            </div>
        )
    }
}

function mapStateToProps(state){
    return { 
        articles: state.article.approvel
    };
}

export default connect(mapStateToProps, { fetchApproveArticles })(Approvalpage);